#
#  RefObject (http://code.google.com/p/refobject/)
#  Copyright (C) 2010-2011 MIURA Shirow (sharow)
#

PROJECTROOT=..

include $(PROJECTROOT)/common.in

TARGET=librefobject.a
TARGETWITHPATH=$(PROJECTROOT)/$(BUILDDIR)/$(TARGET)

INCDIR+=-I$(SPACE)../include

SOURCE=$(shell find . -name "*.c")
OBJECT=$(subst .c,.o, $(SOURCE))

all: $(TARGETWITHPATH)

$(TARGETWITHPATH): $(OBJECT)
	@echo "@ create library $@"
	$(AR) crv $(TARGETWITHPATH) $(OBJECT)

gen_numerics:
	ruby gen_numerics.rb

clean:
	$(RM) -f $(OBJECT)
	$(RM) -f $(TARGETWITHPATH)
	$(RM) -f *~

depend:
	$(RM) -f depend.inc
	$(CC) $(INCDIR) -MM $(SOURCE) > depend.inc

list_source:
	@echo $(SOURCE)

show_depend:
	@cat depend.inc

RefInt.c: RefNumerics.c.template
	make gen_numerics

include depend.inc
